import sqlite3


def get_data(conn):
    """查询数据"""
    cursor = conn.cursor()

    # 查询数据
    cursor.execute("""
        SELECT * FROM Quotes
        """)

    # rows = cursor.fetchall()
    rows = cursor.fetchmany(12)

    for row in rows:
        print(f"ID:{row[0]},名言:{row[1]},作者：{row[2]},标签：{row[3]}")

    conn.close()


if __name__ == '__main__':
    conn = sqlite3.connect('DATA/quotes.db')
    get_data(conn)  # 查询数据
